/*
Kyle Kelly
CS2110-B2 HW8
Header file for first GBA program
*/
#ifndef MYLIB_H
#define MYLIB_H

typedef unsigned short u16;

#define RGB(r,g,b) ((r) | (g)<<5 | (b)<<10)
#define OFFSET(row, col, rowLen) ((r)*(rowLen)+(c))
#define SCREENW 240
#define REG_DISPCNT  (*(u16 *)0x4000000)
#define MODE 3
#define BG2_ENABLE	(1<<10)

//#define BUTTONS (*(unsigned int *) 0x04000130)
//button PRESSED = 0, button RELEASED = 1
//#define BUTTON_A (1)
//#define BUTTON_B (2)
//#define SCANLINECOUNTER *(u16*) 0x4000006
//#define KEY_PRESSED(key) (~(BUTTONS) & key)

extern u16 *videoBuffer;

void setPixel(int r, int c, u16 color);
void drawRect(int r, int c, int width, int height, u16 color);
void waitForVblank();

#endif
